Skip to content

Conversation

@dmitry-krasilnikov
Copy link

  1. There is a problem with allowed redirect URIs check. Redirect URI must start with one of the allowed URIs, it does not have to be fully equal. It is generally accepted practice, for example Slack uses such approach when authorizes clients with OAuth2 protocol.
  2. The second problem is that redirect URIs can contain query strings after '?' symbol, some consumers could use query strings for some sort of reasons. It is better to compare paths without query strings.

I've stumbled on these when I was writing backend for django-social-auth which is used by Sentry.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling a506fda on dmitry-krasilnikov:master into 5ed4f50 on evonove:master.

@dmitry-krasilnikov
Copy link
Author

Hi! I was just curious, have you seen my proposed changes? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to use the urlparse (or Py3 urllib.parse) to do this kind of extraction.

@synasius
Copy link
Contributor

This feature is added with the following commit: d17d3ea

@synasius synasius closed this Jan 15, 2015
@dmitry-krasilnikov
Copy link
Author

Thanks! But what about Grant.redirect_uri_allowed method? It has exactly the same bug, because of full URI comparison including query string

@synasius
Copy link
Contributor

That check is correct. It only applies to the Authorization Code Grant when the Access Token is requested. See http://tools.ietf.org/html/rfc6749#section-4.1.3

redirect_uri
REQUIRED, if the "redirect_uri" parameter was included in the
authorization request as described in Section 4.1.1, and their
values MUST be identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants